package com.ruoyi.system.controller.trade;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.system.domain.db.basic.BasicMaterials;
import com.ruoyi.system.domain.vo.MaterialStoreVo;
import com.ruoyi.system.domain.vo.PageInfo;
import com.ruoyi.system.service.ITradeMaterialStoreService;
import com.ruoyi.system.utils.MyPageUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/trade/material/store")
@Slf4j
public class TradeMaterialStoreController extends BaseController {

    @Resource
    private ITradeMaterialStoreService iTradeMaterialStoreService;


    /**
     * 获取所有物资剩余情况
     *
     * @return
     */
    @PreAuthorize("@ss.hasPermi('trade:material:store:list')")
    @GetMapping("/list")
    public PageInfo<MaterialStoreVo> list(BasicMaterials basicMaterials) {
        // startPage();
        List<MaterialStoreVo> materialStoreVos = iTradeMaterialStoreService.selectAll(basicMaterials);
        return MyPageUtils.startPage(materialStoreVos);
    }


}
